import request from '@/utils/axios'

export type SocialClientType = {
  id: number
  name: string
  socialType: number
  userType: number
  clientId: string
  clientSecret: string
  agentId: string
  status: number
}

export interface SocialClientPageReqType extends PageParam {
  name?: string
  status?: number
  socialType?: string
  userType?: number
  clientId?: string
}

/**
 * 三方登录 三方应用客户端接口
 */
export const SocialClientApi = {
  // 新增
  create: (data: SocialClientType) => {
    return request.post({ url: '/system/social-client/create', data, is_mock: true })
  },
  // 修改
  update: (data: SocialClientType) => {
    return request.put({ url: '/system/social-client/update', data, is_mock: true })
  },
  // 删除
  delete: (id: number) => {
    return request.delete({ url: '/system/social-client/delete?id=' + id, is_mock: true })
  },
  // 查询详情
  detail: (id: number) => {
    return request.get({ url: '/system/social-client/detail?id=' + id, is_mock: true })
  },
  // 查询分页列表
  page: (params: SocialClientPageReqType) => {
    return request.get({ url: '/system/social-client/page', params, is_mock: true })
  }
}
